//
//  MyFanViewController.m
//  ForengnMenu
//
//  Created by @-@ on 16/1/19.
//  Copyright © 2016年 余旺. All rights reserved.
//

#import "MyFanViewController.h"
#import "MyFanTableViewCell.h"
#import "FanInfoViewController.h"

@interface MyFanViewController ()

@property NSArray * users;

@property NSArray * headerImages;

@property NSArray * Names;

@property NSArray * times;

@property NSArray * news;

@property NSArray * array;


@end

@implementation MyFanViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    UILabel * l = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 80, 40)];
    l.text = @"我的粉丝";
    l.textAlignment = NSTextAlignmentCenter;
    self.navigationItem.titleView = l;
    
    self.headerImages = @[@"01",@"05"];
    self.Names = @[@"海中念",@"照顾好自己"];
    self.times = @[@"2015-12-03",@"2016-01-08"];
    self.news = @[@"在?",@"你们已经是好友了，赶快打声招呼吧"];
    
    NSDictionary * dic1 =@{@"image":@"01",
                           @"name" :@"海中念",
                           @"sex":@"女 25岁 上海",
                           @"title" :@" 账号信息:",
                           @"content" : @"83265982",
                           @"title1" : @"个性签名:",
                           @"content1" : @"女人能炒菜是贤惠",
                           @"title2" : @"他的二维码:",
                           @"content2" : @""
                           
                           };
    
    NSDictionary * dic2 =@{@"image":@"05",
                           @"name" :@"照顾好自己",
                           @"sex":@"女 34岁 重庆",
                           @"title" :@"账号信息:",
                           @"content" : @"2358235258",
                           @"title1" : @"个性签名:",
                           @"content1" : @"绑住男人的胃",
                           @"title2" : @"他的二维码:",
                           @"content2" : @""
                           };
    
    self.array = @[dic1,dic2];

    
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.headerImages.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString * identifier = @"cell";
    MyFanTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    
    cell.MyFanHeaderImage.image = [UIImage imageNamed:self.headerImages[indexPath.row]];
    cell.myFanNameLabel.text = self.Names[indexPath.row];
    cell.myFanTimeLabel.text = self.times[indexPath.row];
    cell.myFanNewsLabel.text = self.news[indexPath.row];
    
    return cell;
}


#pragma mark  -UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    [self performSegueWithIdentifier:@"showOtherInfo2" sender:self.array[indexPath.row]];
    
}


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    
    
    FanInfoViewController * controller = segue.destinationViewController;
    controller.info = sender;
    
    
}

@end
